<?php

use Workerman\Worker;

require_once "./vendor/autoload.php";

$tcp_worker = new Worker('tcp://0.0.0.0:9100');

$tcp_worker->onWorkerStart = function () {
    echo "worker did start";
};

$tcp_worker->onConnect = function ($connection) {
    echo "client connect id:".$connection->id;
};

$tcp_worker->onMessage = function ($connection, $data) {
    var_dump($data);
};

Worker::runAll();
